package com.culture.system.service.impl;

import com.culture.common.utils.DateUtils;
import com.culture.system.domain.CultureLeaveMessage;
import com.culture.system.mapper.CultureLeaveMessageMapper;
import com.culture.system.service.ICultureLeaveMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * leaveMessageService业务层处理
 *
 * @author lidongsheng
 * @date 2025-03-27
 */
@Service
public class CultureLeaveMessageServiceImpl implements ICultureLeaveMessageService
{
    @Autowired
    private CultureLeaveMessageMapper cultureLeaveMessageMapper;

    /**
     * 查询leaveMessage
     *
     * @param id leaveMessage主键
     * @return leaveMessage
     */
    @Override
    public CultureLeaveMessage selectCultureLeaveMessageById(Long id)
    {
        return cultureLeaveMessageMapper.selectCultureLeaveMessageById(id);
    }

    /**
     * 查询leaveMessage列表
     *
     * @param cultureLeaveMessage leaveMessage
     * @return leaveMessage
     */
    @Override
    public List<CultureLeaveMessage> selectCultureLeaveMessageList(CultureLeaveMessage cultureLeaveMessage)
    {
        return cultureLeaveMessageMapper.selectCultureLeaveMessageList(cultureLeaveMessage);
    }

    /**
     * 新增leaveMessage
     *
     * @param cultureLeaveMessage leaveMessage
     * @return 结果
     */
    @Override
    public int insertCultureLeaveMessage(CultureLeaveMessage cultureLeaveMessage)
    {
        cultureLeaveMessage.setCreateTime(DateUtils.getNowDate());
        return cultureLeaveMessageMapper.insertCultureLeaveMessage(cultureLeaveMessage);
    }

    /**
     * 修改leaveMessage
     *
     * @param cultureLeaveMessage leaveMessage
     * @return 结果
     */
    @Override
    public int updateCultureLeaveMessage(CultureLeaveMessage cultureLeaveMessage)
    {
        cultureLeaveMessage.setUpdateTime(DateUtils.getNowDate());
        return cultureLeaveMessageMapper.updateCultureLeaveMessage(cultureLeaveMessage);
    }

    /**
     * 批量删除leaveMessage
     *
     * @param ids 需要删除的leaveMessage主键
     * @return 结果
     */
    @Override
    public int deleteCultureLeaveMessageByIds(Long[] ids)
    {
        return cultureLeaveMessageMapper.deleteCultureLeaveMessageByIds(ids);
    }

    /**
     * 删除leaveMessage信息
     *
     * @param id leaveMessage主键
     * @return 结果
     */
    @Override
    public int deleteCultureLeaveMessageById(Long id)
    {
        return cultureLeaveMessageMapper.deleteCultureLeaveMessageById(id);
    }
}
